package com.umbrella;

import javax.servlet.MultipartConfigElement;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;

/**
 *
 *
 * @author Wan, ChuanLong @ 03/22/2018
 */

@SpringBootApplication
@EnableCaching
public class UmPlateformApplication {

	final static Logger LOG = LoggerFactory.getLogger(UmPlateformApplication.class);
	
	public static void main(String[] args) {

		SpringApplication app = new SpringApplication(UmPlateformApplication.class);
		app.setBannerMode(Banner.Mode.OFF);
		app.setLogStartupInfo(false);
		app.run(args);

	}
	
	@Bean
	public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();

        factory.setMaxFileSize("512000KB");
        factory.setMaxRequestSize("512000KB");
        return factory.createMultipartConfig();
    }
}
